
{% extends 'dashboard/base.html' %}

{% block body %}

        <div class="row">
            <div class="col-md-12">
                <div class="card">
                    <div class="card-body">
                        <br>
                        <div class="d-md-flex align-items-center">
                            <h1 class="card-title">Edit Vulnerability</h1>
                        </div>
                        <br>
                        <div class="row">
                            <div class="col-md-12">
                                <div class="card">
                                    <form class="form-vertical" action="{% url 'pentest:edit_vuln' %}?vuln_id={{ vuln_id }}" method="POST">
                                        {% csrf_token %}
                                        <div class="card-body">{% for data in vuln_data %}
                                            <input type="hidden" name="vuln_id" value="{{ vuln_id }}">
                                            <input type="hidden" name="project_id" value="{{ project_id }}">
                                            <input type="hidden" name="scan_id" value="{{ data.scan_id }}">
                                            <div class="form-group row">
                                                <label class="col-md-3 m-t-15"></label>
                                            </div>
                                            <div class="form-group row">
                                                <label class="col-md-3 m-t-15">Vulnerability Name</label>
                                                <div class="col-sm-8">
                                                    <input name="vuln_name" type="text" class="form-control"
                                                           value="{{data.vuln_name}}" placeholder="Last Name Here">
                                                </div>
                                            </div>

                                            <div class="form-group row">
                                                <label class="col-md-3 m-t-15">Severity</label>
                                                <div class="col-sm-8">
                                                    <select name="vuln_severity"
                                                            class="select2 form-control custom-select"
                                                            style="width: 30%; height:36px;">
                                                        <option selected value="{{data.severity}}">{{data.severity}}</option>
                                                        <option value="High">High</option>
                                                        <option value="Medium">Medium</option>
                                                        <option value="Low">Low</option>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="form-group row">
                                                <label
                                                        class="col-md-3 m-t-15">Instance:</label>
                                                <div class="col-sm-8">
                                                    <textarea name="vuln_instance" class="form-control"
                                                              placeholder="Instances">{{data.vuln_url}}</textarea>
                                                </div>
                                            </div>
                                            <div class="form-group row">
                                                <label
                                                        class="col-md-3 m-t-15">Description:</label>
                                                <div class="col-sm-8">
                                                    <textarea name="vuln_description" class="form-control"
                                                              placeholder="Company Name Here">{{data.description}}</textarea>
                                                </div>
                                            </div>
                                            <div class="form-group row">
                                                <label
                                                        class="col-md-3 m-t-15">Solution</label>
                                                <div class="col-sm-8">
                                                    <textarea name="vuln_solution" class="form-control"
                                                              placeholder="Contact No Here">{{data.solution}}</textarea>
                                                </div>
                                            </div>
                                            <div class="form-group row">
                                                <label
                                                        class="col-md-3 m-t-15">Reference</label>
                                                <div class="col-sm-8">
                                                    <textarea name="vuln_reference" class="form-control">
                                                        {{data.reference}}</textarea>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="float-right">
                                                <div class="form-actions">
                                                    <button type="submit" class="btn btn-success">Save</button>
                                                </div>
                                            </div>
                                    </form>
                                    {% endfor %}
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

{% endblock %}